package com.yh.ldzl.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.web.page.PageDomain;
import com.ruoyi.common.core.web.page.TableSupport;
import com.ruoyi.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yh.ldzl.mapper.QcIqcLineMapper;
import com.yh.ldzl.domain.QcIqcLine;
import com.yh.ldzl.service.IQcIqcLineService;

/**
 * 来料检验单行Service业务层处理
 * 
 * @author yanghuai
 * @date 2025-07-04
 */
@Service
public class QcIqcLineServiceImpl implements IQcIqcLineService 
{
    @Autowired
    private QcIqcLineMapper qcIqcLineMapper;

    /**
     * 查询来料检验单行
     * 
     * @param lineId 来料检验单行主键
     * @return 来料检验单行
     */
    @Override
    public QcIqcLine selectQcIqcLineByLineId(Long lineId)
    {
        return qcIqcLineMapper.selectQcIqcLineByLineId(lineId);
    }

    /**
     * 查询来料检验单行列表
     * 
     * @param qcIqcLine 来料检验单行
     * @return 来料检验单行
     */
    @Override
    public List<QcIqcLine> selectQcIqcLineList(QcIqcLine qcIqcLine)
    {
        PageDomain pageDomain = TableSupport.buildPageRequest();
        Integer pageNum = pageDomain.getPageNum();
        Integer pageSize = pageDomain.getPageSize();
        return qcIqcLineMapper.selectQcIqcLineList(qcIqcLine);
    }

    /**
     * 新增来料检验单行
     * 
     * @param qcIqcLine 来料检验单行
     * @return 结果
     */
    @Override
    public boolean insertQcIqcLine(QcIqcLine qcIqcLine)
    {
        qcIqcLine.setCreateBy(SecurityUtils.getUsername());
        return qcIqcLineMapper.insertQcIqcLine(qcIqcLine)>0;
    }

    /**
     * 修改来料检验单行
     * 
     * @param qcIqcLine 来料检验单行
     * @return 结果
     */
    @Override
    public boolean updateQcIqcLine(QcIqcLine qcIqcLine)
    {
        qcIqcLine.setUpdateBy(SecurityUtils.getUsername());
        return qcIqcLineMapper.updateQcIqcLine(qcIqcLine)>0;
    }

    /**
     * 批量删除来料检验单行
     * 
     * @param lineIds 需要删除的来料检验单行主键
     * @return 结果
     */
    @Override
    public boolean deleteQcIqcLineByLineIds(Long[] lineIds)
    {
        return qcIqcLineMapper.deleteQcIqcLineByLineIds(lineIds)>0;
    }

    /**
     * 删除来料检验单行信息
     * 
     * @param lineId 来料检验单行主键
     * @return 结果
     */
    @Override
    public boolean deleteQcIqcLineByLineId(Long lineId)
    {
        return qcIqcLineMapper.deleteQcIqcLineByLineId(lineId)>0;
    }
}
